import { createStyleImportPlugin } from 'vite-plugin-style-import'

export function styleImportPlugin() {
  return createStyleImportPlugin({
    resolves: [],
    libs: [
      {
        libraryName: 'naive-ui',
        esModule: true,
        resolveStyle: (name) => {
          const removePrefix = name.replace('n-', '')
          return `naive-ui/es/${removePrefix}/styles/index`
        }
      }
    ]
  })
}
